<template>
  <div class="app">
    <el-container>
      <el-aside width="200px" style="border-right: 1px solid gray">
        <div
          style="
            height: 60px;
            line-height: 60px;
            padding: 0 20px;
            font-weight: 700;
          "
        >
          客户关系管理系统
        </div>
        <hr />
        <el-row class="tac">
          <el-col>
            <el-menu
              default-active="2"
              class="el-menu-vertical-demo"
              @open="handleOpen"
              @close="handleClose"
              active-text-color="#ffd04b"
            >
              <el-menu-item index="1" @click="nav('/', '首页')">
                <i class="el-icon-s-home"></i>
                <span slot="title"> 首页 </span>
              </el-menu-item>
              <el-menu-item
                index="2"
                @click="nav('/CustomerManage', '客户管理')"
              >
                <i class="el-icon-s-custom"></i>
                <span slot="title">客户管理</span>
              </el-menu-item>
              <el-menu-item index="3" @click="nav('/OrderManage', '订单管理')">
                <i class="el-icon-s-order"></i>
                <span slot="title"> 订单管理 </span>
              </el-menu-item>
              <el-menu-item index="4" @click="nav('/userManage', '用户管理')">
                <i class="el-icon-user-solid"></i>
                <span slot="title"> 用户管理</span>
              </el-menu-item>
            </el-menu>
          </el-col>
        </el-row>
        <login-cart class="login-cart"></login-cart>
      </el-aside>

      <el-container>
        <el-header style="text-align: center; font-weight: 700">{{
          name
        }}</el-header>
        <hr />
        <el-main><router-view /></el-main>
      </el-container>
    </el-container>
  </div>
</template>



<script>
import LoginCart from "./components/LoginCart.vue";

export default {
  components: {
    LoginCart,
  },
  data() {
    return {
      name: "首页",
    };
  },
  methods: {
    nav(path, name) {
      this.$router.push(path);
      this.name = name;
    },
  },
};
</script>

<style lang="less" scoped>
.app {
  height: 100vh;
}
.login-cart {
  position: absolute;
  bottom: 0;
  width: 100%;
}
</style>

<style>
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  /* border: 1px solid red; */
  /* background-color: black; */
  /* color: white; */
  text-decoration: none;
}

.el-header {
  /* background-color: #b3c0d1; */
  color: #333;
  line-height: 60px;
}

.el-aside {
  position: relative;
  /* background-color: #c0b3d1; */
  color: #333;
  height: calc(100vh);
}

.el-main {
  /* background-color: #eb7814; */
}
</style>
